<template>
    <div :ref="id"></div>
</template>
<script>
import * as echarts from 'echarts';
export default {
    props: {
        id: String,
        options: Object
    },
    mounted() {
        this.chart = echarts.init(this.$refs[this.id])
        this.chart.setOption(this.options);
    },

    watch: {
        options() {
            this.chart = echarts.init(this.$refs[this.id])
            this.chart.setOption(this.options);
        }
    }

}
</script>